home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / utils / bibtools / bibkey.sed < prev    next >
Text File  |  1992-09-03  |  751b  |  33 lines

  1. # bibkey.sed
  2. #
  3. # Goes with bin/bibkey - look for a word in the keyword entry 
  4. #
  5. # David Kotz (dfk@cs.dartmouth.edu)
  6. #
  7. # On stdin, we get a lowercased bibtex file with comments stripped.
  8. #
  9. # On stdout, we produce a list of line numbers that are the starting
  10. # line number of each reference, and the text of all "keyword"
  11. # entries on separate lines.
  12.  
  13. # the idea is to get @ line numbers and all keywords
  14. # @ entry
  15. /^[     ]*@.*/=
  16. # one-line keyword entry
  17. s/[     ]*keyword[     ]*=[     ]*"\(.*\)".*/\1/p
  18. # start of multi-line keyword entry
  19. s/[     ]*keyword[     ]*=[     ]*"\(.*\)/\1/
  20. t partial
  21. b
  22. # Handle multi-line keyword entry: save this line, repeatedly add
  23. # lines until close quote forces output
  24. :partial
  25. N
  26. s/\(.*\n.*\)".*/\1/
  27. t done
  28. b partial
  29. :done
  30. s/\n/ /g
  31. p
  32.